import request from '@/utils/request'

export function taskList(query) {
  return request({
    url: '/task/list',
    method: 'get',
    params: query
  })
}

export function taskAdd(data) {
  return request({
    url: '/task/create',
    method: 'post',
    data
  })
}

export function taskDel(id) {
  return request({
    url: `/task/delete/${id}`,
    method: 'delete'
  })
}

export function taskUpdate(data) {
  return request({
    url: '/task/update',
    method: 'post',
    data
  })
}

export function taskStatus(data) {
  return request({
    url: '/task/deactivate',
    method: 'post',
    data
  })
}

export function taskDetail(id) {
  return request({
    url: `/task/${id}`,
    method: 'get'
  })
}

export function taskRecordList(query) {
  return request({
    url: '/taskRecord/list',
    method: 'get',
    params: query
  })
}

export function taskRecordDetail(id) {
  return request({
    url: `/taskRecord/${id}`,
    method: 'get'
  })
}

export function taskRecordDetailList(query) {
  return request({
    url: `/taskRecord/getTaskRecordDetailById`,
    method: 'get',
    params: query
  })
}

